#include "SettingPanel.h"
#include <QSpinBox>

SettingPanel::SettingPanel (QWidget *parent) : QWidget (parent)
{
	ui.setupUi(this);
	_pSetting = new CalibrationSetting ();
	connect (ui.spCheckRows, SIGNAL(valueChanged(int)),
			_pSetting, SLOT(setCheckRows(int)));
	connect (ui.spCheckCols, SIGNAL(valueChanged(int)),
			_pSetting, SLOT(setCheckCols(int)));
	connect (ui.txCheckSize, SIGNAL(textEdited(QString)),
			_pSetting, SLOT(setCheckSize(QString)));
	connect (ui.spMaxFrames, SIGNAL(valueChanged(int)),
			_pSetting, SLOT(setMaxFrames(int)));
	ui.spCheckCols->setValue (_pSetting->getCheckCols ());
	ui.spCheckRows->setValue (_pSetting->getCheckRows ());
	ui.txCheckSize->setText (_pSetting->getCheckSize ());
	ui.spMaxFrames->setValue (_pSetting->getMaxFrames ());
	ui.txCheckSize->setValidator (new QDoubleValidator (this));
}

SettingPanel::~SettingPanel ()
{
	delete _pSetting;
}

const CalibrationSetting* SettingPanel::getSetting () const
{
	return _pSetting;
}
